//分发饼干 力扣455
//贪心 局部最优：将饼分给能当前能满足的食量最大的孩子
class Solution {
public:
	int findContentChildren(vector<int>& g, vector<int>& s) {
		sort(g.begin(),g.end());
		sort(s.begin(),s.end());
		int ps = 0;
		int pg = 0;
		int cnt = 0;
		while(ps < s.size() && pg < g.size())
		{
			if(s[ps] >= g[pg])
			{
				cnt++;
				ps++;
				pg++;
			}
			else
			{
				ps++;
			}
			
		}
		return cnt;
	}
};
